[PATCH 1/2] md: raid5 return new layout in mdstat while reshaping

From: Maciej Trela <maciej.trela [at] intel.com>

While reshaping, report mdstat algorithm according to the new_layout.

Signed-off-by: Maciej Trela <maciej.trela [at] intel.com>
---
drivers/md/raid5.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 4d85632..b7c6561 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
[at] [at] -5256,8 +5256,12 [at] [at] static void status(struct seq_file *seq, mddev_t *mddev)
raid5_conf_t *conf = mddev->private;
int i;

- seq_printf(seq, " level %d, %dk chunk, algorithm %d", mddev->level,
- mddev->chunk_sectors / 2, mddev->layout);
+ seq_printf(seq, " level %d, %dk chunk,", mddev->level,
+ mddev->chunk_sectors / 2);
+ if (mddev->reshape_position != MaxSector)
+ seq_printf(seq, " algorithm %d", mddev->new_layout);
+ else
+ seq_printf(seq, " algorithm %d", mddev->layout);
seq_printf (seq, " [%d/%d] [", conf->raid_disks, conf->raid_disks - mddev->degraded);
for (i = 0; i < conf->raid_disks; i++)
seq_printf (seq, "%s",
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Maciej.Trela [ Mi, 21 Juli 2010 13:03 ] [ ID #2044841 ]

Re: [PATCH 1/2] md: raid5 return new layout in mdstat while reshaping

On Wed, Jul 21, 2010 at 4:03 AM, Trela, Maciej <Maciej.Trela [at] intel.com> wrote:
> From: Maciej Trela <maciej.trela [at] intel.com>
>
> While reshaping, report mdstat algorithm according to the new_layout.

It's not immediately clear to me why this is needed? The md/layout
attribute in sysfs shows the new_layout during reshape if userspace
forgets what it changed (should also be recorded in the metadata). If
it is needed then spell that out in the commit message.

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
dan.j.williams [ Do, 22 Juli 2010 02:58 ] [ ID #2044906 ]
Linux » gmane.linux.raid » [PATCH 1/2] md: raid5 return new layout in mdstat while reshaping

Vorheriges Thema: [mdadm GIT PULL] rebuild checkpoints, incremental assembly, volumedelete/rename, and fixes
Nächstes Thema: help needed - 4 disk raid4 with two missing disks